<template>
  <div class="father">
    <div class="son1">
      <p class="p1" @click="tsizebtn" :class="{fsize:tday}">
        昨天{{gettime1}}
      </p>
      <p class="p2"  @click="sizebtn" :class="{fsize:day}">
今天{{gettime}}
      </p>
       <p class="p3"  @click="ysizebtn" :class="{fsize:yday}">
         设置
      </p>
    </div>
      <div class="son2">
     <div v-show="day"><Mor></Mor></div>
     <div v-show="tday"><Tmor></Tmor> </div>
     <div v-show="yday"><Ymor></Ymor></div>
    </div>
  </div>
</template>
<script>
import Ymor from './Ymor'
import Mor from './Mor'
import Tmor from './Tmor'
export default {
data () {
  return {
    fsize:'fsize',
    tday:false,
    yday:false,
    day:true

  }
},
components: {
  Mor,
  Tmor,
  Ymor
},
methods: {
  tsizebtn:function(){
    this.tday=true
    this.yday=false
    this.day=false
  },
   sizebtn:function(){
    this.tday=false
    this.yday=false
    this.day=true
  },
  ysizebtn:function(){
    this.yday=true
    this.tday=false
    this.day=false
  },
},
computed: {
    gettime:function(){
       let date = new Date();
    return  (date.getMonth() + 1) + '.' +(date.getDate());
    },
    gettime1:function(){
       let date = new Date();
    return  (date.getMonth() + 1) + '.' +(date.getDate() - 1);
    }
},
}
</script>

<style scoped>
.father{
  position: relative;
}
.son1{
  position: absolute;
  width: 90%;
  margin-left: 5%;
  margin-top: -3rem;
  margin-left: 1rem;
  line-height: 0.3rem;
  text-align: center;
  color:white;
}
.son2{
  position: absolute;
  width: 90%;
  margin-left: 5%;
  height: 13.5rem;
  text-align: center;
  /* line-height: 500px; */
  border:1px solid red;
  top: 0.1rem;
  border-radius:1rem;
  margin-top: -2rem;
  background-color:white;
}
img{
  width: 100px;
  margin-top: 6rem;
}
p{
display: inline-block;
}
.fsize{
  font-size: 0.5rem;
}
.p1{
  float: left;
}

.p3{
  float: right;
  margin-right: 1rem;
}
a {
  text-decoration: none;
  color:white;
}
.router-link-active {
  text-decoration: none;
}
</style>